import { defHttp } from '/@/utils/http/axios';
enum Api {
  list="/actTask/todoList",
  doneList='/actTask/doneList',
  deleteHistoricTask='/actTask/deleteHistoric/',
  pass='/actTask/pass',
  back='/actTask/back',
  backToTask='/actTask/backToTask',
  delegate='/actTask/delegate',
  getForm='/actBusiness/getForm',
}

export const getForm = (params) => defHttp.get({ url: Api.getForm, params });

//待审
export const list = (params) => defHttp.get({ url: Api.list, params });
//已审
export const doneList = (params) => defHttp.get({ url: Api.doneList, params });



export const pass = (params) =>{ 
  defHttp.post({ url: Api.pass,
    data: params,
    headers:{'Content-Type':'application/x-www-form-urlencoded'}
  }) 
};

export const back = (params) =>{ 
  defHttp.post({ url: Api.back,
    data: params,
    headers:{'Content-Type':'application/x-www-form-urlencoded'}
  }) 
};
export const delegate = (params) =>{ 
  defHttp.post({ url: Api.delegate,
    data: params,
    headers:{'Content-Type':'application/x-www-form-urlencoded'}
  }) 
};

export const deleteHistoricTask = (params, handleSuccess) => {
  return defHttp.post({ url: Api.deleteHistoricTask+params.ids }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};